<?php
/**
 * TimoPHP a Fast Simple Smart PHP FrameWork
 * Author: Tommy 863758705@qq.com
 * Link: http://www.TimoPHP.com/
 * Since: 2016
 */

namespace Timo\Core;


class Exception extends \Exception
{
    /**
     * 获取异常信息
     *
     * @param bool $output
     * @return bool|string
     */
    public function getHtml($output = false)
    {
        $html = '<div class="exception">';
        $html .= '<p>[' . $this->getCode() . '] Exception in ' . $this->getFile() . ' Line '
            . $this->getLine() . '</p>';
        $html .= '<p>Notice: ' . $this->getMessage() . '</p>';
        if (!$output) {
            return $html;
        } else {
            echo $html;
            return true;
        }
    }
}
